<div class="row-fluid">
	<div class="span12">
		<ul class="breadcrumb">
			<li>
				<a href="index.php"><i class="radmin-icon radmin-home"></i> <?php echo t('page', 'Dashboard'); ?></a>
				<span class="divider">/</span>
			</li>
			<li>
				<a href="user-list.php"><i class="radmin-icon radmin-user"></i> <?php echo t('page', 'Users'); ?></a>
				<span class="divider">/</span>
			</li>
			<li class="active">
				<i class="radmin-icon radmin-accessibility"></i> <?php echo t('page', 'Permissions'); ?>
			</li>
		</ul>
	</div>
</div>

<div class="row-fluid">
	<div class="span12">
		<h4 class="title">
			<?php $this->widget('application.components.mywidgets.WikiHelp', array('wiki' => 'user_role_permission')); ?> <?php echo t('page', 'User Role Permissions'); ?>
		</h4>
		<div class="squiggly-border"></div>
		<?php echo CHtml::dropDownList('id_user_role', $selectedRoleId, $existedRole, array('prompt' => t('info', 'Select Role to Modify'))); ?> <br /><br />
		<?php if(!empty($notification)): ?>
			<div class="row-fluid">
				<div class="span12">
					<div class="alert alter-block alert-info">
						<h4>Sucess</h4>
						<div class="content"><?php echo $notification; ?></div>
					</div>
				</div>
			</div>
		<?php endif; ?>

		<ul class="nav nav-tabs" id="permissionTab">
			<li class="active"><a href="#access"><?php echo t('page', 'WHM Account Access'); ?></a></li>
			<li><a href="#permission"><?php echo t('page', 'Actions &amp; Permissions'); ?></a></li>
		</ul>
		<div class="tab-content">
			<?php $this->renderPartial('forms/permission/_access_modify', array('existedGroups' => $existedGroups, 'existedWhmAccounts' => $existedWhmAccounts)); ?>
			<?php $this->renderPartial('forms/permission/_permissions_modify', array()); ?>
		</div>
	</div>
</div>

<script>
	$(function(){
		$('#permissionTab a[href="#group"]').tab('show');
	});
	
	$(document).ready(function(){
		$('#permissionTab a').click(function(e){
			e.preventDefault();
			$(this).tab('show');
		});

		$('#id_user_role').change(function(){
			$('.id_user_role_hidden').val(
				$(this).val()
			);
		}).change();
	});
</script>
